<template>
	<view class="qian">
		<view class="aptext">
			<view class="wodedd">
				<view class="qbsghui" v-for="(item,index) in itemList" :key="index"
					:class="{ qbsg: selectedIdx === index }" @click="selectItem(index)">
					<view class="">
						{{item.name}}
					</view>
					<view :class="{ qbsga: selectedIdx === index }">
					</view>
				</view>
			</view>
			<view class="information">
				<view class="yiquan">
					<view class="dange" v-for="item in neir.firstRec" :key="item.id" v-if="selectedIdx==0">
						<view class="img" v-if="item.memberHeadUrl == null">
							<image src="../../static/zhengshu/6583.png" mode=""></image>
						</view>
						<view class="img" v-else>
							<image :src="item.memberHeadUrl" mode=""></image>
						</view>
						<view class="you">
							<view class="name">
								<view class="wodema">
									{{item.masterName}}
								</view>
								<view class="ztai">
									推荐成功
								</view>
							</view>
							<view class="sjh">
								{{item.memberName}}
							</view>
							<view class="tuij">
								推荐日期：{{item.createTime}}
							</view>
						</view>
					</view>
					<view class="dange" v-for="item in neir.secondRec" :key="item.id" v-if="selectedIdx==1">
						<view class="img" v-if="item.memberHeadUrl == null">
							<image src="../../static/zhengshu/6583.png" mode=""></image>
						</view>
						<view class="img" v-else>
							<image :src="item.memberHeadUrl" mode=""></image>
						</view>
						<view class="you">
							<view class="name">
								<view class="wodema">
									{{item.masterName}}
								</view>
								<view class="ztai">
									推荐成功
								</view>
							</view>
							<view class="sjh">
								{{item.memberName}}
							</view>
							<view class="tuij">
								推荐日期：{{item.createTime}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		myRecommend
	} from '../../request/api.js'
	export default {
		data() {
			return {
				selectedIdx: 0,
				itemList: [{
						name: '团长'
					},
					{
						name: '团员'
					}
				],
				neir: []
			}
		},
		onLoad() {

		},
		onShow() {
			this.myRecommend()
		},
		methods: {
			myRecommend() {
				myRecommend().then(res => {
					console.log(res, 'tuijian');
					this.neir = res.result
				})
			},
			selectItem(index) {
				this.selectedIdx = index;
			},
		}
	}
</script>


<style scoped lang="less">
	.qian {
		background: #FAFAFA;
		height: 100vh;
	}

	.wodedd {
		margin-left: 24rpx;
		height: 100rpx;
		display: flex;
		border-radius: 16rpx 16rpx 16rpx 16rpx;

		justify-content: space-around;
		background-color: #ffffff;
		margin-top: 20rpx;



		.qbsghui {

			height: 100rpx;
			background: #ffffff;

			font-weight: 400;
			font-size: 30rpx;
			color: #000;
			align-items: center;
			text-align: center;
			line-height: 88rpx;

		}

		.qbsg {

			height: 100rpx;
			color: #00BE94;
			align-items: center;
			text-align: center;
			line-height: 88rpx;
			// border-bottom: 6px solid #F8492E;
		}
	}

	.qbsga {
		width: 64rpx;
		height: 6rpx;
	}

	.information {
		margin-top: 24rpx;
	}

	.yiquan {
		.dange {
			width: 702rpx;
			height: 201rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin: 0 auto;
			display: flex;
			padding: 32rpx 24rpx;
			box-sizing: border-box;

			.img {
				width: 96rpx;
				height: 96rpx;
				background: #DEDEE8;
				border-radius: 50rpx;
				margin-right: 16rpx;

				image {
					width: 96rpx;
					height: 96rpx;

				}
			}

			.you {
				width: 80%;

				.name {

					display: flex;
					justify-content: space-between;

					.wodema {

						font-weight: 500;
						font-size: 32rpx;
						color: #2C3133;

						font-style: normal;
						text-transform: none;
					}

					.ztai {

						font-weight: 400;
						font-size: 28rpx;
						color: #2C3133;

						font-style: normal;
						text-transform: none;
					}
				}

				.sjh {

					font-weight: 400;
					font-size: 26rpx;
					color: #999999;
					font-style: normal;
					text-transform: none;
					margin-top: 16rpx;
					margin-bottom: 8rpx;
				}

				.tuij {

					font-weight: 400;
					font-size: 26rpx;
					color: #999999;
					font-style: normal;
					text-transform: none;
				}
			}
		}
	}
</style>